package com.itlong.cloud.property.resource;

import com.itlong.cloud.POJO.DTO.property.PropertySMSAccountInfoDTO;
import com.itlong.cloud.POJO.DTO.property.PropertySMSOverviewDTO;
import com.itlong.cloud.POJO.VO.property.PropertySMSAccountInfoVO;
import com.itlong.cloud.POJO.VO.property.PropertySMSOverviewVO;
import com.itlong.cloud.noncore.property.IPropertySMSOverviewServiceClient;
import com.itlong.cloud.property.service.IPropertySMSOverviewService;
import com.itlong.cloud.utils.page.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * <desc>
 *    短信概览 服务暴露接口实现类.
 * </desc>
 *
 * @createDate 2017-10-19
 */
@RestController
public class PropertySMSOverviewServiceResource implements IPropertySMSOverviewServiceClient {

    @Autowired
    IPropertySMSOverviewService iPropertySMSOverviewService;

    /**
     * <desc>
     *      分页获取 短信概览
     * <desc/>
     *
     * @param pageDTO 分页获取 参数
     * @return
     * @author ZiXuan
     * @createDate 2017-10-19
     */
    @RequestMapping(path = "/settings/smsOverview/getPage",method = {RequestMethod.POST})
    public Page<PropertySMSOverviewVO> getPage(@RequestBody PropertySMSOverviewDTO pageDTO) throws Exception{
        Page<PropertySMSOverviewVO> page = iPropertySMSOverviewService.getPage(pageDTO);
        return  page;
    }

    /**
     * <desc>
     *     短信统计
     * <desc/>
     *
     * @param pageDTO   信息DTO
     * @return
     * @author ZiXuan
     * @createDate 2017-10-23
     */
    @RequestMapping(path = "/settings/smsOverview/getSMSAccountInfo", method = {RequestMethod.POST})
    public PropertySMSAccountInfoVO getSMSAccountInfo(@RequestBody PropertySMSAccountInfoDTO pageDTO) throws Exception{
        PropertySMSAccountInfoVO data = iPropertySMSOverviewService.getSMSAccountInfo(pageDTO);
        return  data;
    }
}
